package com.lhd.action.visitor;

/**
 * @Author: liuhd
 * @Date: 2024/12/19 15:28
 * @Description:
 */
public class Client {
    public static void main(String[] args) {
        GoodsCart goodsCart = new GoodsCart();
        goodsCart.addProduct(new Apple());
        goodsCart.addProduct(new Book());

        goodsCart.setVisitor(new VisitorA());
        goodsCart.accept();

        goodsCart.setVisitor(new VisitorB());
        goodsCart.accept();
    }
}
